package Model;


import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

public class AirConditioner {
    public String get7DData(String rawData) {
        rawData = rawData.replaceAll(" +", " ");
        String arrayData[] = rawData.split(" ");
        Integer dataLength = arrayData.length;
        //空调命令
        String airConditionerCommand="";
        String result = "";
        Integer countNum = 1;
        if (12<dataLength){
            //设定温度
            String SETTMP = arrayData[12];
            int tempeture = Integer.parseInt(SETTMP, 16);
            tempeture = tempeture + 16;
            if (tempeture >= 16 && tempeture <= 30) {
                airConditionerCommand = String.valueOf(tempeture);
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (13<dataLength){
            //设定上下摆风
            String SETUPDN = arrayData[13];
            int SETUPDNInteger = Integer.parseInt(SETUPDN, 16);
            String SETUPDNBinary = Integer.toBinaryString(SETUPDNInteger);
            while (SETUPDNBinary.length() < 8) {
                SETUPDNBinary = "0" + SETUPDNBinary;
            }
            String SETUPDN47 = SETUPDNBinary.substring(0, 4);
            int SETUPDN47decimal = Integer.parseInt(SETUPDN47, 2);

            String SETUPDN03 = SETUPDNBinary.substring(4, 8);
            int SETUPDN03decimal = Integer.parseInt(SETUPDN03, 2);

            switch (SETUPDN47decimal) {
                case 0:
                    airConditionerCommand = "上下摆位置固定";
                    break;
                case 1:
                    airConditionerCommand = "健康气流(上吹)";
                    break;
                case 2:
                    airConditionerCommand = "上下摆位置一";
                    break;
                case 3:
                    airConditionerCommand = "健康气流(下吹)";
                    break;
                case 4:
                    airConditionerCommand = "上下摆位置二";
                    break;
                case 6:
                    airConditionerCommand = "上下摆位置三";
                    break;
                case 8:
                    airConditionerCommand = "上下摆位置四";
                    break;
                case 10:
                    airConditionerCommand = "上下摆位置五";
                    break;
                case 12:
                    airConditionerCommand = "上下摆自动";
                    break;
                case 14:
                    airConditionerCommand = "上下摆自动2";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
            switch (SETUPDN03decimal) {
                case 0:
                    airConditionerCommand = "上下摆位置固定";
                    break;
                case 1:
                    airConditionerCommand = "健康气流(上吹)";
                    break;
                case 2:
                    airConditionerCommand = "上下摆位置一";
                    break;
                case 3:
                    airConditionerCommand = "健康气流(下吹)";
                    break;
                case 4:
                    airConditionerCommand = "上下摆位置二";
                    break;
                case 6:
                    airConditionerCommand = "上下摆位置三";
                    break;
                case 8:
                    airConditionerCommand = "上下摆位置四";
                    break;
                case 10:
                    airConditionerCommand = "上下摆位置五";
                    break;
                case 12:
                    airConditionerCommand = "上下摆自动";
                    break;
                case 14:
                    airConditionerCommand = "上下摆自动2";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (14<dataLength){
            //设定模式，设定左风区风度
            String SETUPMDWD = arrayData[14];
            int SETUPMDWDInteger = Integer.parseInt(SETUPMDWD, 16);
            String SETUPMDWDBinary = Integer.toBinaryString(SETUPMDWDInteger);
            while (SETUPMDWDBinary.length() < 8) {
                SETUPMDWDBinary = "0" + SETUPMDWDBinary;
            }
            String SETUPMDWD57 = SETUPMDWDBinary.substring(0, 3);
            String SETUPMDWD34 = SETUPMDWDBinary.substring(3, 5);
            String SETUPMDWD02 = SETUPMDWDBinary.substring(5, 8);
            int SETUPMDWD57decimal = Integer.parseInt(SETUPMDWD57, 2);
            switch (SETUPMDWD57decimal) {
                case 0:
                    airConditionerCommand = "智能/自动/舒适";
                    break;
                case 1:
                    airConditionerCommand = "制冷";
                    break;
                case 2:
                    airConditionerCommand = "除湿";
                    break;
                case 3:
                    airConditionerCommand = "健康除湿";
                    break;
                case 4:
                    airConditionerCommand = "制热";
                    break;
                case 5:
                    airConditionerCommand = "节能模式";
                    break;
                case 6:
                    airConditionerCommand = "送风";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
            int SETUPMDWD34decimal = Integer.parseInt(SETUPMDWD34, 2);
            switch (SETUPMDWD34decimal) {
                case 0:
                    airConditionerCommand = "无特殊模式";
                    break;
                case 1:
                    airConditionerCommand = "老人特殊模式";
                    break;
                case 2:
                    airConditionerCommand = "儿童特殊模式";
                    break;
                case 3:
                    airConditionerCommand = "孕妇特殊模式";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
            int SETUPMDWD02decimal = Integer.parseInt(SETUPMDWD02, 2);
            switch (SETUPMDWD02decimal) {
                case 1:
                    airConditionerCommand = "高风";
                    break;
                case 2:
                    airConditionerCommand = "中风";
                    break;
                case 3:
                    airConditionerCommand = "低风";
                    break;
                case 4:
                    airConditionerCommand = "空不用";
                    break;
                case 5:
                    airConditionerCommand = "自动";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        //预留 15
        if (16<dataLength){
            //字A
            String wordA1 = arrayData[16];
            int wordA1Integer = Integer.parseInt(wordA1, 16);
            String wordA1Binary = Integer.toBinaryString(wordA1Integer);
            while (wordA1Binary.length() < 8) {
                wordA1Binary = "0" + wordA1Binary;
            }
            String wordA2 = arrayData[17];
            int wordA2Integer = Integer.parseInt(wordA2, 16);
            String wordA2Binary = Integer.toBinaryString(wordA2Integer);
            while (wordA2Binary.length() < 8) {
                wordA2Binary = "0" + wordA2Binary;
            }
            String wordABinary = wordA1Binary + wordA2Binary;
            char Zero = wordABinary.charAt(15);
            char First = wordABinary.charAt(14);
            char Second = wordABinary.charAt(13);
            char Third = wordABinary.charAt(12);
            char Fourth = wordABinary.charAt(11);
            char Fifth = wordABinary.charAt(10);
            char Sixth = wordABinary.charAt(9);
            char Seventh = wordABinary.charAt(8);//无
            char Eigth = wordABinary.charAt(7);
            char Ninth = wordABinary.charAt(6);
            char Tenth = wordABinary.charAt(5);
            char Eleventh = wordABinary.charAt(4);
            char Twelveth = wordABinary.charAt(3);
            char Thirteenth = wordABinary.charAt(2);
            char Fourteenth = wordABinary.charAt(1);
            char Fifteenth = wordABinary.charAt(0);
            switch (Zero) {
                case '0':
                    airConditionerCommand = "关机";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开机";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (First) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (Second) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (Third) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (Fourth) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (Fifth) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (Sixth) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (Eigth) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (Ninth) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (Tenth) {
                case '0':
                    airConditionerCommand = "无";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "有";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (Eleventh) {
                case '0':
                    airConditionerCommand = "无";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "有";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (Twelveth) {
                case '0':
                    airConditionerCommand = "无";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "有";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (Thirteenth) {
                case '0':
                    airConditionerCommand = "摄氏显示";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "华氏显示";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
        }
        if (18<dataLength){
            //设定湿度
            String SETHUMIDITY = arrayData[18];
            int SETHUMIDITYInteger = Integer.parseInt(SETHUMIDITY, 16);
            airConditionerCommand = String.valueOf(SETHUMIDITYInteger + 30);
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (19<dataLength){
            //设定感人模式，右风区风速，左风区左右摆风 （有问题）
            String SETPERADLR = arrayData[19];
            int SETPERADLRInteger = Integer.parseInt(SETPERADLR, 16);
            String SETPERADLRBinary = Integer.toBinaryString(SETPERADLRInteger);
            while (SETPERADLRBinary.length() < 8) {
                SETPERADLRBinary = "0" + SETPERADLRBinary;
            }
            String SETPERADLR67 = SETPERADLRBinary.substring(0, 2);
            String SETPERADLR35 = SETPERADLRBinary.substring(2, 5);
            String SETPERADLR02 = SETPERADLRBinary.substring(5, 8);
            int SETPERADLR67decimal = Integer.parseInt(SETPERADLR67, 2);
            switch (SETPERADLR67decimal) {
                case 0:
                    airConditionerCommand = "关闭感人功能";
                    break;
                case 1:
                    airConditionerCommand = "感人避让";
                    break;
                case 2:
                    airConditionerCommand = "感人跟随";
                    break;
                case 3:
                    airConditionerCommand = "感人";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;

            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
            int SETPERADLR35decimal = Integer.parseInt(SETPERADLR35, 2);
            switch (SETPERADLR35decimal) {
                case 1:
                    airConditionerCommand = "高风";
                    break;
                case 2:
                    airConditionerCommand = "中风";
                    break;
                case 3:
                    airConditionerCommand = "低风";
                    break;
                case 4:
                    airConditionerCommand = "空不用";
                    break;
                case 5:
                    airConditionerCommand = "自动";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
            int SETPERADLR02decimal = Integer.parseInt(SETPERADLR02, 2);
            switch (SETPERADLR02decimal) {
                case 0:
                    airConditionerCommand = "左右摆位置一";
                    break;
                case 1:
                    airConditionerCommand = "左右摆位置二";
                    break;
                case 2:
                    airConditionerCommand = "左右摆位置三";
                    break;
                case 3:
                    airConditionerCommand = "左右摆位置四";
                    break;
                case 4:
                    airConditionerCommand = "左右摆位置五";
                    break;
                case 5:
                    airConditionerCommand = "左右摆位置六";
                    break;
                case 6:
                    airConditionerCommand = "左右摆位置七";
                    break;
                case 7:
                    airConditionerCommand = "左右摆位置八";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (21<dataLength){
            //字B
            String wordB1 = arrayData[20];
            String wordB2 = arrayData[21];
            int wordB1Integer = Integer.parseInt(wordB1, 16);
            String wordB1Binary = Integer.toBinaryString(wordB1Integer);
            while (wordB1Binary.length() < 8) {
                wordB1Binary = "0" + wordB1Binary;
            }
            int wordB2Integer = Integer.parseInt(wordB2, 16);
            String wordB2Binary = Integer.toBinaryString(wordB2Integer);
            while (wordB2Binary.length() < 8) {
                wordB2Binary = "0" + wordB2Binary;
            }
            String wordBBinary = wordB1Binary + wordB2Binary;
            char ZeroB = wordBBinary.charAt(15);
            char FirstB = wordBBinary.charAt(14);
            char SecondB = wordBBinary.charAt(13);
            char ThirdB = wordBBinary.charAt(12);
            char FourthB = wordBBinary.charAt(11);
            char FifthB = wordBBinary.charAt(10);
            char SixthB = wordBBinary.charAt(9);
            char SeventhB = wordBBinary.charAt(8);//无
            char EigthB = wordBBinary.charAt(7);
            char NinthB = wordBBinary.charAt(6);
            char TenthB = wordBBinary.charAt(5);
            char EleventhB = wordBBinary.charAt(4);
            //转换成16进制
            String temp911 = String.valueOf(NinthB) + String.valueOf(TenthB) + String.valueOf(EleventhB);
            Integer temp911Integer = Integer.parseInt(temp911);
            switch (ZeroB) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (FirstB) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (SecondB) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (ThirdB) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (FourthB) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (FifthB) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (SixthB) {
                case '0':
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (EigthB) {
                case '0':
                    airConditionerCommand = "本机端净化累计时间未到，不需提醒用户更换滤网";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case '1':
                    airConditionerCommand = "本机端净化累计时间未到，需提醒用户更换滤网";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (temp911Integer) {
                case 0:
                    airConditionerCommand = "左右摆位置一";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case 1:
                    airConditionerCommand = "左右摆位置二";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case 2:
                    airConditionerCommand = "左右摆位置三";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case 3:
                    airConditionerCommand = "左右摆位置四";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case 4:
                    airConditionerCommand = "左右摆位置五";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case 5:
                    airConditionerCommand = "左右摆位置六";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case 6:
                    airConditionerCommand = "左右摆位置七";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case 7:
                    airConditionerCommand = "左右摆位置八(自动)";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
        }
        if (22<dataLength){
            //室内环境温度
            String TEMP = arrayData[22];
            Integer TEMPInteger = Integer.parseInt(TEMP, 16);
            double TEMPIntegerd = TEMPInteger * 0.5;
            if (TEMPIntegerd >= 0 && TEMPIntegerd <= 110) {
                airConditionerCommand = String.valueOf(TEMPIntegerd);
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (23<dataLength){
            //室内环境湿度
            String HUMIDITY = arrayData[23];
            Integer HUMIDITYInteger = Integer.parseInt(HUMIDITY, 16);
            if (HUMIDITYInteger >= 0 && HUMIDITYInteger <= 100) {
                if (HUMIDITYInteger == 0) {
                    //airConditionerCommand = "无传感器";
                    //airConditionerCommand = "N";
                    airConditionerCommand = "无此功能";
                } else {
                    airConditionerCommand = String.valueOf(HUMIDITYInteger);
                }
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (24<dataLength){
            //室外环境温度
            String OUTTEMP = arrayData[24];
            if (OUTTEMP != "00") {
                Integer OUTTEMPInteger = Integer.parseInt(OUTTEMP, 16);
                Integer outTempeture = OUTTEMPInteger - 64;
                if (outTempeture >= 0 && outTempeture <= 255) {
                    airConditionerCommand = String.valueOf(outTempeture);
                } else {
                    airConditionerCommand = "N";
                }
            } else {
                //airConditionerCommand = "无传感器";
                //airConditionerCommand = "N";
                airConditionerCommand = "无此功能";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (25<dataLength){
            //机型 空气质量等级
            String AIRPM = arrayData[25];
            String AIRPMBinary = Integer.toBinaryString(Integer.parseInt(AIRPM));
            while (AIRPMBinary.length() < 8) {
                AIRPMBinary = "0" + AIRPMBinary;
            }
            char AIRPM7 = AIRPMBinary.charAt(0);
            char AIRPM6 = AIRPMBinary.charAt(1);//预留
            char AIRPM5 = AIRPMBinary.charAt(2);
            char AIRPM4 = AIRPMBinary.charAt(3);
            String AIRPM54 = String.valueOf(AIRPM5) + String.valueOf(AIRPM4);
            char AIRPM3 = AIRPMBinary.charAt(4);
            char AIRPM2 = AIRPMBinary.charAt(5);
            String AIRPM32 = String.valueOf(AIRPM3) + String.valueOf(AIRPM2);
            char AIRPM1 = AIRPMBinary.charAt(6);
            char AIRPM0 = AIRPMBinary.charAt(7);
            String AIRPM10 = String.valueOf(AIRPM1) + String.valueOf(AIRPM0);
            switch (AIRPM7) {
                case '0':
                    airConditionerCommand = "冷暖机型";
                    break;
                case '1':
                    airConditionerCommand = "单冷机型";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
            switch (AIRPM54) {
                case "00":
                    airConditionerCommand = "无此功能";
                    break;
                case "01":
                    airConditionerCommand = "无人";
                    break;
                case "02":
                    airConditionerCommand = "单人";
                    break;
                case "03":
                    airConditionerCommand = "多人";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
            switch (AIRPM32) {
                case "00":
                    airConditionerCommand = "优";
                    break;
                case "01":
                    airConditionerCommand = "良";
                    break;
                case "02":
                    airConditionerCommand = "中";
                    break;
                case "03":
                    airConditionerCommand = "差";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
            switch (AIRPM10) {
                case "00":
                    airConditionerCommand = "优";
                    break;
                case "01":
                    airConditionerCommand = "良";
                    break;
                case "02":
                    airConditionerCommand = "中";
                    break;
                case "03":
                    airConditionerCommand = "差";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }








        //故障代码
        /*String ERROR = arrayData[26];
        Integer errorInteger = Integer.parseInt(ERROR,16);
        switch (errorInteger){
            case 0:
                airConditionerCommand = "无报警信息";
                break;
            case 1:
                airConditionerCommand = "室外模块故障";
                break;
            case 2:
                airConditionerCommand = "室外除霜传感器故障";
                break;
            case 3:
                airConditionerCommand = "室外压缩机排气传感器故障";
                break;
            case 4:
                airConditionerCommand = "室外EEPROM异常";
                break;
            case 5:
                airConditionerCommand = "室内盘管传感器故障";
                break;
            case 6:
                airConditionerCommand = "室内外通讯故障";
                break;
            case 7:
                airConditionerCommand = "电源过压保护";
                break;
            case 8:
                airConditionerCommand = "面板与内机通信故障";
                break;
            case 9:
                airConditionerCommand = "室外压机过热保护";
                break;
            case 10:
                airConditionerCommand = "室外环境传感器异常";
                break;
            case 11:
                airConditionerCommand = "满水保护";
                break;
            case 12:
                airConditionerCommand = "室内EEPROM异常";
                break;
            case 13:
                airConditionerCommand = "室外回气传感器故障";
                break;
            case 14:
                airConditionerCommand = "CBD与模块通讯故障";
                break;
            case 15:
                airConditionerCommand = "室内风机故障";
                break;
            case 16:
                airConditionerCommand = "室外直流风机故障";
                break;
            case 17:
                airConditionerCommand = "门开关故障";
                break;
            case 18:
                airConditionerCommand = "除尘网需要清洗提示";
                break;
            case 19:
                airConditionerCommand = "缺水保护";
                break;
            case 20:
                airConditionerCommand = "湿度传感器故障";
                break;
            case 21:
                airConditionerCommand = "室内温度传感器故障";
                break;
            case 22:
                airConditionerCommand = "机械手限位故障";
                break;
            case 23:
                airConditionerCommand = "室内PM2.5传感器故障";
                break;
            case 24:
                airConditionerCommand = "室外PM2.5传感器故障";
                break;
            case 25:
                airConditionerCommand = "室内制热过载/高负荷报警";
                break;
            case 26:
                airConditionerCommand = "室外AC电流保护";
                break;
            case 27:
                airConditionerCommand = "室外压机运转异常";
                break;
            case 28:
                airConditionerCommand = "室外DC电流保护";
                break;
            case 29:
                airConditionerCommand = "室外无负载故障";
                break;
            case 30:
                airConditionerCommand = "CT电流异常";
                break;
            case 31:
                airConditionerCommand = "室内制冷结冰保护";
                break;
            case 32:
                airConditionerCommand = "高低压力保护";
                break;
            case 33:
                airConditionerCommand = "压机回气温度过高";
                break;
            case 34:
                airConditionerCommand = "室外蒸发传感器故障";
                break;
            case 35:
                airConditionerCommand = "室外制冷过载";
                break;
            case 36:
                airConditionerCommand = "水泵排水故障";
                break;
            case 37:
                airConditionerCommand = "三相电电源故障";
                break;
            case 38:
                airConditionerCommand = "四通阀故障";
                break;
            case 39:
                airConditionerCommand = "外部报警/耙流开关异常";
                break;
            case 40:
                airConditionerCommand = "温度截止保护报警";
                break;
            case 41:
                airConditionerCommand = "异模式运转故障";
                break;
            case 42:
                airConditionerCommand = "电子膨胀阀故障";
                break;
            case 43:
                airConditionerCommand = "双热源传感器Tw故障";
                break;
            case 44:
                airConditionerCommand = "与线控器通讯故障";
                break;
            case 45:
                airConditionerCommand = "室内机地址重复故障";
                break;
            case 46:
                airConditionerCommand = "50Hz过零故障";
                break;
            case 47:
                airConditionerCommand = "室外机故障";
                break;
            case 48:
                airConditionerCommand = "甲醛传感器故障";
                break;
            case 49:
                airConditionerCommand = "VOC传感器故障";
                break;
            case 50:
                airConditionerCommand = "CO2传感器故障";
                break;
            case 51:
                airConditionerCommand = "防火墙故障@1";
                break;
            default:
                airConditionerCommand = "N";
                break;
        }
        result += countNum+":"+airConditionerCommand+"@";
        countNum++;*/

        if (27<dataLength){
            //控制命令来源
            String NOP = arrayData[27];
            String NOPBinary = Integer.toBinaryString(Integer.parseInt(NOP));
            while (NOPBinary.length() < 8) {
                NOPBinary = "0" + NOPBinary;
            }
            String NOP7 = NOPBinary.substring(0, 1);
            String NOP64 = NOPBinary.substring(1, 4);
            String NOP32 = NOPBinary.substring(4, 6);
            String NOP10 = NOPBinary.substring(6, 8);
            switch (NOP7) {
                case "0":
                    airConditionerCommand = "无";
                    break;
                case "1":
                    airConditionerCommand = "有";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
           /* switch (NOP32) {
                case "00":
                    airConditionerCommand = "制冷";
                    break;
                case "01":
                    airConditionerCommand = "除湿";
                    break;
                case "02":
                    airConditionerCommand = "制热";
                    break;
                case "03":
                    airConditionerCommand = "送风";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;*/
            switch (NOP10) {
                case "00":
                    airConditionerCommand = "其他";
                    break;
                case "01":
                    airConditionerCommand = "遥控器";
                    break;
                case "02":
                    airConditionerCommand = "按键";
                    break;
                case "03":
                    airConditionerCommand = "网络";
                    break;
                default:
                    airConditionerCommand = "N";
                    break;
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (29<dataLength){
            //净化功能底板累计时间
            String CLEAN = arrayData[28] + arrayData[29];
            Integer CLEANInteger = Integer.parseInt(CLEAN, 16);
            if (CLEANInteger >= 0 && CLEANInteger <= 65535) {
                airConditionerCommand = CLEANInteger.toString();
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (31<dataLength){
            //室内PM2.5实际值
            String PM25 = arrayData[30] + arrayData[31];
            Integer PM25Integer = Integer.parseInt(PM25, 16);
            if (PM25Integer >= 0 && PM25Integer <= 4095) {
                if (PM25Integer == 0) {
                    //airConditionerCommand = "无PM2.5传感器";
                    airConditionerCommand = "N";
                } else {
                    airConditionerCommand = PM25Integer.toString();
                }
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (33<dataLength){
            //室外PM2.5实际值
            String PM25Out = arrayData[32] + arrayData[33];
            Integer PM25OutInteger = Integer.parseInt(PM25Out, 16);
            if (PM25OutInteger >= 0 && PM25OutInteger <= 4095) {
                if (PM25OutInteger == 0) {
                    // airConditionerCommand = "无PM2.5传感器";
                    //airConditionerCommand = "N";
                    airConditionerCommand = "无此功能";
                } else {
                    airConditionerCommand = PM25OutInteger.toString();
                }
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (35<dataLength){
            //甲醛实际值formaldehyde
            String formaldehyde = arrayData[34] + arrayData[35];
            Integer formaldehydeInteger = Integer.parseInt(formaldehyde, 16);
            if (formaldehydeInteger >= 0 && formaldehydeInteger <= 10000) {
                if (formaldehydeInteger == 0) {
                    //airConditionerCommand = "无甲醛传感器";
                    //airConditionerCommand = "N";
                    airConditionerCommand = "无此功能";
                } else {
                    airConditionerCommand = formaldehydeInteger.toString();
                }
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (37<dataLength){
            //空气质量(VOC传感器)
            String airQuality = arrayData[36] + arrayData[37];
            Integer airQualityInteger = Integer.parseInt(airQuality, 16);
            if (airQualityInteger >= 0 && airQualityInteger <= 1023) {
                if (airQualityInteger == 0) {
                    //airConditionerCommand = "无VOC传感器";
                   // airConditionerCommand = "N";
                    airConditionerCommand = "无此功能";
                } else {
                    airConditionerCommand = airQualityInteger.toString();
                }

            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (39<dataLength){
            //二氧化碳实际值
            String carbonDioxide = arrayData[38] + arrayData[39];
            Integer carbonDioxideInteger = Integer.parseInt(carbonDioxide, 16);
            if (carbonDioxideInteger >= 0 && carbonDioxideInteger <= 10000) {
                if (carbonDioxideInteger == 0) {
                    //airConditionerCommand = "无CO2传感器";
                    //airConditionerCommand = "N";
                    airConditionerCommand = "无此功能";
                } else {
                    airConditionerCommand = carbonDioxideInteger.toString();
                }
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (41<dataLength){
            //功率
            String power = arrayData[40] + arrayData[41];
            Integer powerInteger = Integer.parseInt(power, 16);
            if (powerInteger >= 0 && powerInteger <= 65535) {
                airConditionerCommand = powerInteger.toString();
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (42<dataLength){
            //室内盘管温度
            String indoorCoil = arrayData[42];
            Integer indoorCoilInteger = Integer.parseInt(indoorCoil, 16);
            if (indoorCoilInteger >= 0 && indoorCoilInteger <= 255) {
                double indoorCoilDouble = indoorCoilInteger * 0.5 - 20;
                airConditionerCommand = String.valueOf(indoorCoilDouble);
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (43<dataLength){
            //室外吐气温度
            String outT = arrayData[43];
            Integer outTInteger = Integer.parseInt(outT, 16);
            if (outTInteger >= 0 && outTInteger <= 255) {
                outTInteger = outTInteger - 64;
                airConditionerCommand = outTInteger.toString();
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (44<dataLength){
            //室外盘管温度
            String outdoorCoil = arrayData[44];
            Integer outdoorCoilInteger = Integer.parseInt(outdoorCoil, 16);
            if (outdoorCoilInteger >= 0 && outdoorCoilInteger <= 255) {
                if (outdoorCoilInteger == 0) {
                    //airConditionerCommand = "无传感器";
                   // airConditionerCommand = "N";
                    airConditionerCommand = "无此功能";
                } else {
                    outdoorCoilInteger = outdoorCoilInteger - 64;
                    airConditionerCommand = outdoorCoilInteger.toString();
                }
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (45<dataLength){
            //室外吸气温度
            String inhale = arrayData[45];
            Integer inhaleInteger = Integer.parseInt(inhale, 16);
            if (inhaleInteger >= 0 && inhaleInteger <= 255) {
                if (inhaleInteger == 0) {
                   // airConditionerCommand ="无传感器";
                    //airConditionerCommand = "N";
                    airConditionerCommand = "无此功能";
                } else {
                    inhaleInteger = inhaleInteger - 64;
                    airConditionerCommand = inhaleInteger.toString();
                }
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (46<dataLength){
            //室外除霜温度
            String outDefrost = arrayData[46];
            Integer outDefrostInteger = Integer.parseInt(outDefrost, 16);
            if (outDefrostInteger >= 0 && outDefrostInteger <= 255) {
                if (outDefrostInteger == 0) {
                    //airConditionerCommand ="无传感器";
                    //airConditionerCommand = "N";
                    airConditionerCommand = "无此功能";
                } else {
                    outDefrostInteger = outDefrostInteger - 64;
                    airConditionerCommand = outDefrostInteger.toString();
                }
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (47<dataLength){
            //压机频率
            String frequency = arrayData[47];
            Integer frequencyInteger = Integer.parseInt(frequency, 16);
            if (frequencyInteger == 0) {
                airConditionerCommand = "关机";
            } else {
                airConditionerCommand = frequencyInteger.toString();
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (49<dataLength){
            //压机电流
            String electricCurrent1 = arrayData[48];
            int electricCurrent1Integer = Integer.parseInt(electricCurrent1, 16);
            String electricCurrent1Binary = Integer.toBinaryString(electricCurrent1Integer);
            while (electricCurrent1Binary.length() < 8) {
                electricCurrent1Binary = "0" + electricCurrent1Binary;
            }
            String electricCurrent2 = arrayData[49];
            int electricCurrent2Integer = Integer.parseInt(electricCurrent2, 16);
            String electricCurrent2Binary = Integer.toBinaryString(electricCurrent2Integer);
            while (electricCurrent2Binary.length() < 8) {
                electricCurrent2Binary = "0" + electricCurrent2Binary;
            }
            String electricCurrent = electricCurrent1Binary + electricCurrent2Binary;
            String current = electricCurrent.substring(7, 16);
            Integer currentInteger = Integer.parseInt(current, 2);
            DecimalFormat df = new DecimalFormat("0.0");
            if (currentInteger >= 0 && currentInteger <= 511) {
                double currentDouble = currentInteger * 0.1;
                String doubleResult = df.format(currentDouble);
                airConditionerCommand = String.valueOf(doubleResult);
            } else {
                airConditionerCommand = "N";

            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        if (51<dataLength){
            //字D
            String wordD1 = arrayData[50];
            int wordD1Integer = Integer.parseInt(wordD1, 16);
            String wordD1Binary = Integer.toBinaryString(wordD1Integer);
            while (wordD1Binary.length() < 8) {
                wordD1Binary = "0" + wordD1Binary;
            }
            String wordD2 = arrayData[51];
            int wordD2Integer = Integer.parseInt(wordD2, 16);
            String wordD2Binary = Integer.toBinaryString(wordD2Integer);
            while (wordD2Binary.length() < 8) {
                wordD2Binary = "0" + wordD2Binary;
            }
            String wordDBinary = wordD1Binary + wordD2Binary;
            char ZeroD = wordDBinary.charAt(15);
            char FirstD = wordDBinary.charAt(14);
            String ZeroDFirstD = String.valueOf(FirstD) + String.valueOf(ZeroD);
            char SecondD = wordDBinary.charAt(13);
            char ThirdD = wordDBinary.charAt(12);
            String ThirdDSecondD = String.valueOf(ThirdD) + String.valueOf(SecondD);
            char FourthD = wordDBinary.charAt(11);
            char FifthD = wordDBinary.charAt(10);
            String FifthDFourthD = String.valueOf(FifthD) + String.valueOf(FourthD);
            char SixthD = wordDBinary.charAt(9);
            char SeventhD = wordDBinary.charAt(8);
            String SeventhDSixthD = String.valueOf(SeventhD) + String.valueOf(SixthD);
            char EigthD = wordDBinary.charAt(7);
            char NinthD = wordDBinary.charAt(6);
            String NinthDEigthD = String.valueOf(NinthD) + String.valueOf(EigthD);
            char TenthD = wordDBinary.charAt(5);
            char EleventhD = wordDBinary.charAt(4);
            String EleventhDTenthD = String.valueOf(EleventhD) + String.valueOf(TenthD);
            switch (ZeroDFirstD) {
                case "00":
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "01":
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "10":
                    airConditionerCommand = "信息无法获得";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (ThirdDSecondD) {
                case "00":
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "01":
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "10":
                    airConditionerCommand = "信息无法获得";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (FifthDFourthD) {
                case "00":
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "01":
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "10":
                    airConditionerCommand = "信息无法获得";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (SeventhDSixthD) {
                case "00":
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "01":
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "10":
                    airConditionerCommand = "信息无法获得";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (NinthDEigthD) {
                case "00":
                    airConditionerCommand = "关闭";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "01":
                    airConditionerCommand = "开启";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "10":
                    airConditionerCommand = "信息无法获得";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
            switch (EleventhDTenthD) {
                case "00":
                    airConditionerCommand = "非除霜状态";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "01":
                    airConditionerCommand = "除霜状态";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                case "10":
                    airConditionerCommand = "信息无法获得";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
                default:
                    airConditionerCommand = "N";
                    result += countNum + ":" + airConditionerCommand + "@";
                    countNum++;
                    break;
            }
        }
        if (53<dataLength){
            //电子膨胀阀开度
            String elecExpand = arrayData[52] + arrayData[53];
            Integer elecExpandInteger = Integer.parseInt(elecExpand, 16);
            if (elecExpandInteger >= 0 && elecExpandInteger <= 4095) {
                airConditionerCommand = elecExpandInteger.toString();
            } else {
                airConditionerCommand = "N";
            }
            result += countNum + ":" + airConditionerCommand + "@";
            countNum++;
        }
        return result;
    }

    public String getAlarm(String rawData) {
        rawData = rawData.replaceAll(" +", " ");
        String arrayData[] = rawData.split(" ");
        String message = arrayData[12] + arrayData[13] + arrayData[14] + arrayData[15] + arrayData[16] + arrayData[17] + arrayData[18] + arrayData[19];
        //设置多种报警信息
        String binary = "";
        for (int i = 0; i < message.length(); i++) {
            String s = Integer.toBinaryString(Integer.parseInt(String.valueOf(message.charAt(i))));
            //拼接串 拼成4位
            while (s.length() < 4) {
                s = "0" + s;
            }
            binary += s;
        }
        //System.out.println("binary:" + binary.length());
        List<Integer> addr = new ArrayList<Integer>();
        if (binary.contains("1")) {
            for (int j = 0; j < binary.length(); j++) {
                if (String.valueOf(binary.charAt(j)).equals("1")) {
                    addr.add(j);
                }
            }
        } else {
            addr.add(64); //当没有报警信息时候使用65
        }

        String alarmSignificant = "";
        for (int k = 0; k < addr.size(); k++) {
            switch (addr.get(k)) {
                case 64:
                    alarmSignificant += "报警解除";
                    alarmSignificant += "@/";
                    break;
                case 63:
                    alarmSignificant += "室外模块故障";
                    alarmSignificant += "@F1,";
                    break;
                case 62:
                    alarmSignificant += "室外除霜传感器异常";
                    alarmSignificant += "@F21,";
                    break;
                case 61:
                    alarmSignificant += "室外压缩机排气传感器异常";
                    alarmSignificant += "@F25,";
                    break;
                case 60:
                    alarmSignificant += "室外EEPROM异常";
                    alarmSignificant += "@F12,";
                    break;
                case 59:
                    alarmSignificant += "室内盘管传感器异常";
                    alarmSignificant += "@E2,";
                    break;
                case 58:
                    alarmSignificant += "室内外通讯故障";
                    alarmSignificant += "@E7,";
                    break;
                case 57:
                    alarmSignificant += "电源过压保护";
                    alarmSignificant += "@F19,";
                    break;
                case 56:
                    alarmSignificant += "面板与内机通信故障";
                    alarmSignificant += "@E8,";
                    break;
                case 55:
                    alarmSignificant += "室内外压机过热保护";
                    alarmSignificant += "@F20,";
                    break;
                case 54:
                    alarmSignificant += "室外环境传感器异常";
                    alarmSignificant += "@F6,";
                    break;
                case 53:
                    alarmSignificant += "满水保护";
                    alarmSignificant += "@无,";
                    break;
                case 52:
                    alarmSignificant += "室内EEPROM异常";
                    alarmSignificant += "@E4,";
                    break;
                case 51:
                    alarmSignificant += "室外回气传感器故障";
                    alarmSignificant += "@F7,";
                    break;
                case 50:
                    alarmSignificant += "CBD与模块通讯故障";
                    alarmSignificant += "@F3,";
                    break;
                case 49:
                    alarmSignificant += "室内风机故障";
                    alarmSignificant += "@E14,";
                    break;
                case 48:
                    alarmSignificant += "室外直流风机故障";
                    alarmSignificant += "@F8,";
                    break;
                case 47:
                    alarmSignificant += "门开关故障";
                    alarmSignificant += "@FC,";
                    break;
                case 46:
                    alarmSignificant += "除尘网需清洗提示";
                    alarmSignificant += "@无,";
                    break;
                case 45:
                    alarmSignificant += "缺水保护";
                    alarmSignificant += "@无,";
                    break;
                case 44:
                    alarmSignificant += "湿度传感器故障";
                    alarmSignificant += "@E10,";
                    break;
                case 43:
                    alarmSignificant += "室内温度传感器异常";
                    alarmSignificant += "@E1,";
                    break;
                case 42:
                    alarmSignificant += "机械手限位故障";
                    alarmSignificant += "@E17,";
                    break;
                case 41:
                    alarmSignificant += "室内PM2.5传感器故障";
                    alarmSignificant += "@无,";
                    break;
                case 40:
                    alarmSignificant += "室外PM2.5传感器故障";
                    alarmSignificant += "@无,";
                    break;
                case 39:
                    alarmSignificant += "室内制热过载/高负荷报警";
                    alarmSignificant += "@无,";
                    break;
                case 38:
                    alarmSignificant += "室外AC电流保护";
                    alarmSignificant += "@无,";
                    break;
                case 37:
                    alarmSignificant += "室内压机运转异常";
                    alarmSignificant += "@无,";
                    break;
                case 36:
                    alarmSignificant += "室外DC电流保护";
                    alarmSignificant += "@无,";
                    break;
                case 35:
                    alarmSignificant += "室外无负载故障";
                    alarmSignificant += "@无,";
                    break;
                case 34:
                    alarmSignificant += "CT电流异常";
                    alarmSignificant += "@无,";
                    break;
                case 33:
                    alarmSignificant += "室内制冷结冰保护";
                    alarmSignificant += "@无,";
                    break;
                case 32:
                    alarmSignificant += "高低压力保护";
                    alarmSignificant += "@无,";
                    break;
                case 31:
                    alarmSignificant += "压机回气温度过高";
                    alarmSignificant += "@无,";
                    break;
                case 30:
                    alarmSignificant += "室外蒸发传感器故障";
                    alarmSignificant += "@无,";
                    break;
                case 29:
                    alarmSignificant += "室外制冷过载";
                    alarmSignificant += "@无,";
                    break;
                case 28:
                    alarmSignificant += "水泵排水故障";
                    alarmSignificant += "@无,";
                    break;
                case 27:
                    alarmSignificant += "三相电电源故障";
                    alarmSignificant += "@无,";
                    break;
                case 26:
                    alarmSignificant += "四通阀故障";
                    alarmSignificant += "@无,";
                    break;
                case 25:
                    alarmSignificant += "外部报警/耙流开关故障";
                    alarmSignificant += "@无,";
                    break;
                case 24:
                    alarmSignificant += "温度截止保护报警";
                    alarmSignificant += "@无,";
                    break;
                case 23:
                    alarmSignificant += "异模式运转故障";
                    alarmSignificant += "@无,";
                    break;
                case 22:
                    alarmSignificant += "电子膨胀阀故障";
                    alarmSignificant += "@无,";
                    break;
                case 21:
                    alarmSignificant += "双热源传感器Tw故障";
                    alarmSignificant += "@无,";
                    break;
                case 20:
                    alarmSignificant += "与线控器通讯故障";
                    alarmSignificant += "@无,";
                    break;
                case 19:
                    alarmSignificant += "室内机地址重复故障";
                    alarmSignificant += "@无,";
                    break;
                case 18:
                    alarmSignificant += "50Hz过零故障";
                    alarmSignificant += "@无,";
                    break;
                case 17:
                    alarmSignificant += "室外机故障";
                    alarmSignificant += "@无,";
                    break;
                case 16:
                    alarmSignificant += "甲醛传感器故障";
                    alarmSignificant += "@无,";
                    break;
                case 15:
                    alarmSignificant += "VOC传感器故障";
                    alarmSignificant += "@无,";
                    break;
                case 14:
                    alarmSignificant += "CO2传感器故障";
                    alarmSignificant += "@无,";
                    break;
                case 13:
                    alarmSignificant += "防火墙故障";
                    alarmSignificant += "@防火墙故障,";
                    break;
            }

        }
        return alarmSignificant;
    }

    public static void main(String[] args) {
        String s = "FF FF 34 40 00 00 00 00 00 02 7D 01 0C 0C 83 00 12 07 00 07 00 0C 22 00 55 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 02 EC 41 6B 00 49 4B 33 00 22 01 15 00 68 48 B2 B9";
        //String s = "FF FF 34 40 00 00 00 00 00 02 7D 01 0C 00 55 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 02 EC 41 6B 00 49 4B 33 00 22 01 15 00 68 48 B2 B9";

        String sssss = "FF FF 12 40 00 00 00 00 00 74 0F 5A 00 00 00 00 00 00 00 00 2F CB 99";
          String ss1 = "FF FF 12 40 00 00 00 00 00 74 0F 5A 00 00 00 00 00 00 00 00 2F CB 99";
        AirConditioner air = new AirConditioner();
        //String ss = air.get7DData(s);
        System.out.println(air.getAlarm(ss1));
        System.out.println(air.get7DData(s));
        // System.out.println(s2);
    }

}
